<?php

/**
 * @author chenshubo
 * 查询物流轨迹
 */
namespace App\Service\OrderService\OrderInterfaceService;

use App\Service\BaseService;
use App\Service\VendorClient\OrderLogisticSearchApi\OrderLogisticSearchApiClient;
use App\Service\Code\Normal;
class QueryLogistic extends BaseService
{    
    /**
     * 获取物流轨迹详情
     * @param array $param
     */
    public function index( $param = [] ) 
    {
        $requestData = $param['requestData'];
        if( empty($requestData['express_sn']) ) {
            return Normal::returnCode(Normal::FAIL,"express_sn 不能为空");
        }
        
        $express_sn = checkFields($requestData['express_sn']);
        if( $express_sn != $requestData['express_sn'] ) {
            return Normal::returnCode(Normal::FAIL,"express_sn 不能包含特殊字符");
        }
        
        $list = OrderLogisticSearchApiClient::instance()->QueryLogisticByExpressSn($express_sn);
        
        return Normal::returnCode(Normal::SUC,"获取成功",$list);
    }
}